<template>
	<view>
		<view class="section-bp flex br-f5 padding-default text-c text-bold">
			<view class="flex-1 padding-m" :class="tabIndex === index?'uni-tab-item-title-active-border':''"
				v-for="(item,index) in tabList" @click="tabChange(item,index)">{{item.name}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "tab-view",
		props: {
			tabList: {
				type: Array,
				default: []
			},
		},
		data() {
			return {
tabIndex:0
			};
		},
		methods: {
			tabChange(item, index) {
				this.tabIndex = index
				this.$emit(
					'doTab', {
						index: index,
						item: item,
					}, 
				);
			}
		}
	}
</script>

<style>

</style>